import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '名称',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '品类',
    align:"center",
    dataIndex: 'categoryId_dictText'
   },
   {
    title: '店铺',
    align:"center",
    dataIndex: 'storeId_dictText'
   },
   {
    title: '链接地址',
    align:"center",
    dataIndex: 'linkAddress'
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'state'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'note'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '品类',
    field: 'categoryId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"yyc_goods_category,name,id"
    },
  },
  {
    label: '店铺',
    field: 'storeId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"yyc_store,name,id"
    },
  },
  {
    label: '链接地址',
    field: 'linkAddress',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'state',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'note',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表单数据
//子表表格配置
export const yycSaleLinkGoodsColumns: JVxeColumn[] = [
    {
      title: '商品',
      key: 'goodId',
      type: JVxeTypes.select,
      options:[],
      dictCode:"yyc_goods,name,id",
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '数量',
      key: 'count',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]


/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}